package com.macro.mall.portal.service.impl;

import com.macro.mall.mapper.BmsMpSlideshowMapper;
import com.macro.mall.model.BmsMpSlideshow;
import com.macro.mall.model.BmsMpSlideshowExample;
import com.macro.mall.portal.dto.BmsMpSlideshowParam;
import com.macro.mall.portal.service.BmsMpSlideshowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商品属性管理Service实现类
 * Created by macro on 2018/4/26.
 */
@Service
public class BmsMpSlideshowServiceImpl implements BmsMpSlideshowService {
    @Autowired
    private BmsMpSlideshowMapper bmsMpSlideshowMapper;

    /**
     * 小程序查询轮播图
     * @return
     */
    @Override
    public List<BmsMpSlideshow> getMpList(BmsMpSlideshowParam bmsMpSlideshowParam) {
        BmsMpSlideshowExample example = new BmsMpSlideshowExample();
        BmsMpSlideshowExample.Criteria criteria = example.createCriteria();
        criteria.andIsEnabled(1);
        return bmsMpSlideshowMapper.selectByExample(example);
    }

    /**
     * 查询小程序轮播图详情
     * @param
     * @return
     */
    @Override
    public BmsMpSlideshow getMpDetail(Long id) {
        return bmsMpSlideshowMapper.selectDetail(id);
    }
}
